/*
 * Copyright (c) 2019-2020, https://api.iot.10086.cn/(https://gitee.com/cmcc-iot-api/iot-card-open-application/).
 */
package cn.iot.card.open.sim.dto.siminfo;

import cn.iot.card.open.constants.Constants;
import cn.stylefeng.roses.core.util.ToolUtil;

/**
 * 机卡绑定
 *
 * @author zhanlele
 * @date 20200326 22:15:02
 * @modify 20200326 zhanlele v1.1.2 创建
 * @since v1.1.2
 */
public class CardBindingDTO {
    /**
     * 绑定位置
     */
    private String bindFor;
    /**
     * cardType 卡类型
     */
    private String cardType;
    /**
     * cardNum 卡号
     */
    private String cardNum;
    /**
     * operType 绑定类型
     * 1：机卡绑定
     * 2：机卡解绑
     * 3：绑定变更
     */
    private String operType;
    /**
     * bindingStyle 绑定方式
     */
    private String bindingStyle;
    /**
     * tac IMEI号
     */
    private String tac;
    /**
     * 绑定的IMEI
     */
    private String imei;

    public String getCardType() {
        return cardType;
    }

    public void setCardType(String cardType) {
        this.cardType = cardType;
    }

    public String getCardNum() {
        return cardNum;
    }

    public void setCardNum(String cardNum) {
        this.cardNum = cardNum;
    }

    public String getOperType() {
        return operType;
    }

    public void setOperType(String operType) {
        this.operType = operType;
    }

    public String getBindingStyle() {
        return bindingStyle;
    }

    public void setBindingStyle(String bindingStyle) {
        this.bindingStyle = bindingStyle;
    }

    public String getTac() {
        return tac;
    }

    public void setTac(String tac) {
        this.tac = tac;
    }

    public String getBindFor() {
        return bindFor;
    }

    public void setBindFor(String bindFor) {
        this.bindFor = bindFor;
    }

    public String getImei() {
        return imei;
    }

    public void setImei(String imei) {
        this.imei = imei;
    }

    @Override
    public String toString() {
        StringBuilder stringBuilder = new StringBuilder();
        switch (cardType) {
            case Constants.REQUEST_PARAM_MSISDN:
                stringBuilder.append("所查询的物联卡号码(MSISDN):").append(cardNum).append(",");
                break;
            case Constants.REQUEST_PARAM_ICCID:
                stringBuilder.append("集成电路卡识别码(ICCID):").append(cardNum).append(",");
                break;
            case Constants.REQUEST_PARAM_IMSI:
                stringBuilder.append("国际移动用户识别码(IMSI):").append(cardNum).append(",");
                break;
        }
        if ("1".equals(operType)) {
            stringBuilder.append("机卡操作:").append("机卡绑定").append(",");
        } else if ("2".equals(operType)) {
            stringBuilder.append("机卡操作:").append("机卡解绑").append(",");
        }else if ("3".equals(operType)) {
            stringBuilder.append("机卡操作:").append("绑定变更").append(",");
        }
        if ("0".equals(bindingStyle)) {
            stringBuilder.append("机卡绑定方式:").append("首话单自动绑定（一对一绑定）").append(",");
            stringBuilder.append("IMEI段:").append(tac);
        } else if ("1".equals(bindingStyle)) {
            stringBuilder.append("机卡绑定方式:").append("人工录入IMEI段（一对多绑定）").append(",");
            stringBuilder.append("IMEI段:").append(tac);
        }
        if (ToolUtil.isNotEmpty(imei)) {
            stringBuilder.append("绑定的IMEI:").append(imei);
        }
        return stringBuilder.toString();
    }
}
